Optimal. Leaf size=266 \[ \frac {(a+b x)^{m+1} (c+d x)^n \left (\frac {b (c+d x)}{b c-a d}\right )^{-n} \, _2F_1\left (m+1,-n;m+2;-\frac {d (a+b x)}{b c-a d}\right ) \left (a^2 d^2 f h (n+1) (n+2)+a b d (n+1) (2 c f h (m+1)-d (m+n+3) (e h+f g))+b^2 \left (c^2 f h (m+1) (m+2)-c d (m+1) (m+n+3) (e h+f g)+d^2 e g (m+n+2) (m+n+3)\right )\right )}{b^3 d^2 (m+1) (m+n+2) (m+n+3)}-\frac {(a+b x)^{m+1} (c+d x)^{n+1} (a d f h (n+2)+b c f h (m+2)-b d (m+n+3) (e h+f g)-b d f h x (m+n+2))}{b^2 d^2 (m+n+2) (m+n+3)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.17, antiderivative size = 266, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.120, Rules used = {147, 70, 69} \[ \frac {(a+b x)^{m+1} (c+d x)^n \left (\frac {b (c+d x)}{b c-a d}\right )^{-n} \, _2F_1\left (m+1,-n;m+2;-\frac {d (a+b x)}{b c-a d}\right ) \left (a^2 d^2 f h (n+1) (n+2)+a b d (n+1) (2 c f h (m+1)-d (m+n+3) (e h+f g))+b^2 \left (c^2 f h (m+1) (m+2)-c d (m+1) (m+n+3) (e h+f g)+d^2 e g (m+n+2) (m+n+3)\right )\right )}{b^3 d^2 (m+1) (m+n+2) (m+n+3)}-\frac {(a+b x)^{m+1} (c+d x)^{n+1} (a d f h (n+2)+b c f h (m+2)-b d (m+n+3) (e h+f g)-b d f h x (m+n+2))}{b^2 d^2 (m+n+2) (m+n+3)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 69
Rule 70
Rule 147
Rubi steps
\begin {align*} \int (a+b x)^m (c+d x)^n (e+f x) (g+h x) \, dx &=-\frac {(a+b x)^{1+m} (c+d x)^{1+n} (b c f h (2+m)+a d f h (2+n)-b d (f g+e h) (3+m+n)-b d f h (2+m+n) x)}{b^2 d^2 (2+m+n) (3+m+n)}+\frac {\left (a^2 d^2 f h (1+n) (2+n)+a b d (1+n) (2 c f h (1+m)-d (f g+e h) (3+m+n))+b^2 \left (c^2 f h (1+m) (2+m)-c d (f g+e h) (1+m) (3+m+n)+d^2 e g (2+m+n) (3+m+n)\right )\right ) \int (a+b x)^m (c+d x)^n \, dx}{b^2 d^2 (2+m+n) (3+m+n)}\\ &=-\frac {(a+b x)^{1+m} (c+d x)^{1+n} (b c f h (2+m)+a d f h (2+n)-b d (f g+e h) (3+m+n)-b d f h (2+m+n) x)}{b^2 d^2 (2+m+n) (3+m+n)}+\frac {\left (\left (a^2 d^2 f h (1+n) (2+n)+a b d (1+n) (2 c f h (1+m)-d (f g+e h) (3+m+n))+b^2 \left (c^2 f h (1+m) (2+m)-c d (f g+e h) (1+m) (3+m+n)+d^2 e g (2+m+n) (3+m+n)\right )\right ) (c+d x)^n \left (\frac {b (c+d x)}{b c-a d}\right )^{-n}\right ) \int (a+b x)^m \left (\frac {b c}{b c-a d}+\frac {b d x}{b c-a d}\right )^n \, dx}{b^2 d^2 (2+m+n) (3+m+n)}\\ &=-\frac {(a+b x)^{1+m} (c+d x)^{1+n} (b c f h (2+m)+a d f h (2+n)-b d (f g+e h) (3+m+n)-b d f h (2+m+n) x)}{b^2 d^2 (2+m+n) (3+m+n)}+\frac {\left (a^2 d^2 f h (1+n) (2+n)+a b d (1+n) (2 c f h (1+m)-d (f g+e h) (3+m+n))+b^2 \left (c^2 f h (1+m) (2+m)-c d (f g+e h) (1+m) (3+m+n)+d^2 e g (2+m+n) (3+m+n)\right )\right ) (a+b x)^{1+m} (c+d x)^n \left (\frac {b (c+d x)}{b c-a d}\right )^{-n} \, _2F_1\left (1+m,-n;2+m;-\frac {d (a+b x)}{b c-a d}\right )}{b^3 d^2 (1+m) (2+m+n) (3+m+n)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.24, size = 195, normalized size = 0.73 \[ \frac {(a+b x)^{m+1} (c+d x)^n \left (\frac {b (c+d x)}{b c-a d}\right )^{-n} \left (b \left (b (d e-c f) (d g-c h) \, _2F_1\left (m+1,-n;m+2;\frac {d (a+b x)}{a d-b c}\right )-(b c-a d) (2 c f h-d (e h+f g)) \, _2F_1\left (m+1,-n-1;m+2;\frac {d (a+b x)}{a d-b c}\right )\right )+f h (b c-a d)^2 \, _2F_1\left (m+1,-n-2;m+2;\frac {d (a+b x)}{a d-b c}\right )\right )}{b^3 d^2 (m+1)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [F] time = 0.96, size = 0, normalized size = 0.00 \[ {\rm integral}\left ({\left (f h x^{2} + e g + {\left (f g + e h\right )} x\right )} {\left (b x + a\right )}^{m} {\left (d x + c\right )}^{n}, x\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (f x + e\right )} {\left (h x + g\right )} {\left (b x + a\right )}^{m} {\left (d x + c\right )}^{n}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [F] time = 0.24, size = 0, normalized size = 0.00 \[ \int \left (f x +e \right ) \left (h x +g \right ) \left (b x +a \right )^{m} \left (d x +c \right )^{n}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (f x + e\right )} {\left (h x + g\right )} {\left (b x + a\right )}^{m} {\left (d x + c\right )}^{n}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.00 \[ \int \left (e+f\,x\right )\,\left (g+h\,x\right )\,{\left (a+b\,x\right )}^m\,{\left (c+d\,x\right )}^n \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: HeuristicGCDFailed} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________